<html>
<head><meta charset="utf-8"><title>anon const unused substs · project-const-generics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/index.html">project-const-generics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html">anon const unused substs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246320008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246320008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246320008">(Jul 17 2021 at 11:24)</a>:</h4>
<p>starting to work on unused substs again today. wrt filtering the predicates we probably want something like  <a href="user_uploads/4715/L9wKI2pAz2gxePa6YELH_eUh/a.png">a.png</a>  .  Going to first actually implement the "only lazily figuring out the used substs" part though</p>
<div class="message_inline_image"><a href="user_uploads/4715/L9wKI2pAz2gxePa6YELH_eUh/a.png" title="a.png"><img src="user_uploads/4715/L9wKI2pAz2gxePa6YELH_eUh/a.png"></a></div>



<a name="246320103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246320103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246320103">(Jul 17 2021 at 11:26)</a>:</h4>
<p>i think that's how the query graph should look in the end, not sure though <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="246328385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246328385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246328385">(Jul 17 2021 at 14:57)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> Welcome back btw. <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="246328446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246328446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246328446">(Jul 17 2021 at 14:58)</a>:</h4>
<p>thanks ^^ still taking my time with everything to not instantly get back to being overwhelmed, but i do enjoy being able to work on stuff again</p>



<a name="246342774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246342774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246342774">(Jul 17 2021 at 20:35)</a>:</h4>
<p>for those interested, the current status is <a href="https://github.com/lcnr/rust/pull/4">https://github.com/lcnr/rust/pull/4</a></p>



<a name="246342790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246342790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246342790">(Jul 17 2021 at 20:35)</a>:</h4>
<p>dealing with unused substs seems to <em>mostly</em>? work</p>



<a name="246342830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246342830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246342830">(Jul 17 2021 at 20:36)</a>:</h4>
<p>however, while I did not intend any changes in behavior, there are two I wasn't able to figure out yet</p>



<a name="246343017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246343017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246343017">(Jul 17 2021 at 20:42)</a>:</h4>
<ul>
<li>an ICE in <code>issue-39211.rs</code> which seems to happen because we try to eval <code>M::Row::DIM</code> without the needed param env?!?, which just seems wrong to me.</li>
</ul>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="n">error</span>: <span class="nc">constant</span><span class="w"> </span><span class="n">expression</span><span class="w"> </span><span class="n">depends</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">generic</span><span class="w"> </span><span class="n">parameter</span><span class="w"></span>
<span class="w">  </span><span class="o">-</span>-&gt; <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">lcnr</span><span class="o">/</span><span class="n">rust2</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">test</span><span class="o">/</span><span class="n">ui</span><span class="o">/</span><span class="n">issues</span><span class="o">/</span><span class="n">issue</span><span class="o">-</span><span class="mf">39211.</span><span class="n">rs</span>:<span class="mi">11</span>:<span class="mi">17</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="n">LL</span><span class="w"> </span><span class="o">|</span><span class="w">     </span><span class="kd">let</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mi">3</span><span class="p">;</span><span class="w"> </span><span class="n">M</span>::<span class="n">Row</span>::<span class="n">DIM</span><span class="p">];</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w">                 </span><span class="o">^^^^^^^^^^^</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="w">   </span><span class="o">=</span><span class="w"> </span><span class="n">note</span>: <span class="nc">this</span><span class="w"> </span><span class="n">may</span><span class="w"> </span><span class="n">fail</span><span class="w"> </span><span class="n">depending</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">what</span><span class="w"> </span><span class="n">value</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">parameter</span><span class="w"> </span><span class="n">takes</span><span class="w"></span>

<span class="n">error</span>: <span class="nc">internal</span><span class="w"> </span><span class="n">compiler</span><span class="w"> </span><span class="n">error</span>: <span class="nc">compiler</span><span class="o">/</span><span class="n">rustc_traits</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">normalize_erasing_regions</span><span class="p">.</span><span class="n">rs</span>:<span class="mi">54</span>:<span class="mi">32</span>: <span class="nc">could</span><span class="w"> </span><span class="n">not</span><span class="w"> </span><span class="n">fully</span><span class="w"> </span><span class="n">normalize</span><span class="w"> </span><span class="err">`</span><span class="o">&lt;</span><span class="n">M</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">Mat</span><span class="o">&gt;</span>::<span class="n">Row</span><span class="err">`</span><span class="w"></span>
</code></pre></div>



<a name="246343058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246343058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246343058">(Jul 17 2021 at 20:43)</a>:</h4>
<ul>
<li>a bunch of const generics test with a const-evaluatable bound error report one error more, e.g. <code>issue-74634.rs</code> which now has</li>
</ul>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="n">error</span>: <span class="nc">constant</span><span class="w"> </span><span class="n">expression</span><span class="w"> </span><span class="n">depends</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">generic</span><span class="w"> </span><span class="n">parameter</span><span class="w"></span>
<span class="w">  </span><span class="o">-</span>-&gt; <span class="cp">$DIR</span><span class="o">/</span><span class="n">issue</span><span class="o">-</span><span class="mf">74634.</span><span class="n">rs</span>:<span class="mi">15</span>:<span class="mi">11</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="n">LL</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="p">()</span>: <span class="nc">If</span><span class="o">&lt;</span><span class="p">{</span><span class="n">N</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">}</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w">           </span><span class="o">^^^^^^^^^^^^</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="w">   </span><span class="o">=</span><span class="w"> </span><span class="n">note</span>: <span class="nc">this</span><span class="w"> </span><span class="n">may</span><span class="w"> </span><span class="n">fail</span><span class="w"> </span><span class="n">depending</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">what</span><span class="w"> </span><span class="n">value</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">parameter</span><span class="w"> </span><span class="n">takes</span><span class="w"></span>

<span class="n">error</span><span class="p">[</span><span class="n">E0308</span><span class="p">]</span>: <span class="nc">mismatched</span><span class="w"> </span><span class="n">types</span><span class="w"></span>
<span class="w">  </span><span class="o">-</span>-&gt; <span class="cp">$DIR</span><span class="o">/</span><span class="n">issue</span><span class="o">-</span><span class="mf">74634.</span><span class="n">rs</span>:<span class="mi">14</span>:<span class="mi">19</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="n">LL</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">impl</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">u8</span><span class="o">&gt;</span><span class="w"> </span><span class="n">IsZero</span><span class="o">&lt;</span><span class="n">N</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">()</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w">                   </span><span class="o">^^^^^^^^^</span><span class="w"> </span><span class="n">expected</span><span class="w"> </span><span class="err">`</span><span class="p">{</span><span class="n">N</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">}</span><span class="err">`</span><span class="p">,</span><span class="w"> </span><span class="n">found</span><span class="w"> </span><span class="err">`</span><span class="p">{</span><span class="n">N</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">}</span><span class="err">`</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="w">   </span><span class="o">=</span><span class="w"> </span><span class="n">note</span>: <span class="nc">expected</span><span class="w"> </span><span class="k">type</span> <span class="err">`</span><span class="p">{</span><span class="n">N</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">}</span><span class="err">`</span><span class="w"></span>
<span class="w">              </span><span class="n">found</span><span class="w"> </span><span class="k">type</span> <span class="err">`</span><span class="p">{</span><span class="n">N</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">}</span><span class="err">`</span><span class="w"></span>

<span class="n">error</span>: <span class="nc">aborting</span><span class="w"> </span><span class="n">due</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="n">previous</span><span class="w"> </span><span class="n">errors</span><span class="w"></span>

<span class="n">For</span><span class="w"> </span><span class="n">more</span><span class="w"> </span><span class="n">information</span><span class="w"> </span><span class="n">about</span><span class="w"> </span><span class="n">this</span><span class="w"> </span><span class="n">error</span><span class="p">,</span><span class="w"> </span><span class="kr">try</span><span class="w"> </span><span class="err">`</span><span class="n">rustc</span><span class="w"> </span><span class="o">--</span><span class="n">explain</span><span class="w"> </span><span class="n">E0308</span><span class="err">`</span><span class="p">.</span><span class="w"></span>
</code></pre></div>
<p>instead of</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="n">error</span>: <span class="nc">constant</span><span class="w"> </span><span class="n">expression</span><span class="w"> </span><span class="n">depends</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">generic</span><span class="w"> </span><span class="n">parameter</span><span class="w"></span>
<span class="w">  </span><span class="o">-</span>-&gt; <span class="cp">$DIR</span><span class="o">/</span><span class="n">issue</span><span class="o">-</span><span class="mf">74634.</span><span class="n">rs</span>:<span class="mi">15</span>:<span class="mi">11</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="n">LL</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="p">()</span>: <span class="nc">If</span><span class="o">&lt;</span><span class="p">{</span><span class="n">N</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">}</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w">           </span><span class="o">^^^^^^^^^^^^</span><span class="w"></span>
<span class="w">   </span><span class="o">|</span><span class="w"></span>
<span class="w">   </span><span class="o">=</span><span class="w"> </span><span class="n">note</span>: <span class="nc">this</span><span class="w"> </span><span class="n">may</span><span class="w"> </span><span class="n">fail</span><span class="w"> </span><span class="n">depending</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">what</span><span class="w"> </span><span class="n">value</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">parameter</span><span class="w"> </span><span class="n">takes</span><span class="w"></span>

<span class="n">error</span>: <span class="nc">aborting</span><span class="w"> </span><span class="n">due</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">previous</span><span class="w"> </span><span class="n">error</span><span class="w"></span>
</code></pre></div>



<a name="246343152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246343152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246343152">(Jul 17 2021 at 20:45)</a>:</h4>
<ul>
<li>an ICE in <code>const-generics/const_evaluatable_checked/associated-consts.rs</code> which ones again happens because of a missing param env</li>
</ul>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(&lt;C as BlockCipher&gt;, [])` during codegen
   |
   = note: delayed at compiler/rustc_trait_selection/src/traits/codegen.rs:68:32
</code></pre></div>
<p>this ICE is the only test going from <code>run-pass</code> to an error/ICE</p>



<a name="246343200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246343200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246343200">(Jul 17 2021 at 20:46)</a>:</h4>
<p>the first 2 errors make it seems like we somehow forget to remember that an error already occurred while the first and last errors seem like something's going wrong with param envs</p>



<a name="246343203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246343203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246343203">(Jul 17 2021 at 20:46)</a>:</h4>
<p>i wasn't able to quickly find the source of either of these issues</p>



<a name="246343311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246343311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246343311">(Jul 17 2021 at 20:50)</a>:</h4>
<p>that's where I am going to stop for this week and I am going look into it next week again. If someone wants to try to figure this out, I would be extremely grateful. Though considering the distinct lack of comments and the size of this PR, I doubt that it will be very enjoyable <span aria-label="sparkles" class="emoji emoji-2728" role="img" title="sparkles">:sparkles:</span></p>



<a name="246401260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246401260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246401260">(Jul 18 2021 at 22:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs/near/246343152">said</a>:</p>
<blockquote>
<ul>
<li>an ICE in <code>const-generics/const_evaluatable_checked/associated-consts.rs</code> which ones again happens because of a missing param env</li>
</ul>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(&lt;C as BlockCipher&gt;, [])` during codegen
   |
   = note: delayed at compiler/rustc_trait_selection/src/traits/codegen.rs:68:32
</code></pre></div>
<p>this ICE is the only test going from <code>run-pass</code> to an error/ICE</p>
</blockquote>
<p>this one seems to be because of this code <a href="https://github.com/lcnr/rust/blob/lazy-anon-const-default-substs/compiler/rustc_middle/src/ty/mod.rs#L1254-L1255">here</a> in <code>ParamEnv::and</code> emptying the param env when we evaluate a const with <code>substs_: None</code> <a href="https://github.com/lcnr/rust/blob/lazy-anon-const-default-substs/compiler/rustc_middle/src/ty/consts/kind.rs#L141-L144">eval code</a></p>



<a name="246428503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246428503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246428503">(Jul 19 2021 at 08:28)</a>:</h4>
<p>alright, had <code>Unevaluated</code> influence the typeflags of <code>ty::Const</code> but I didn't do anything for its own typeflags, so when using <code>unevaluated.visit_with(&amp;mut HasTypeFlagsVisitor { .. })</code> we got the wrong flags</p>



<a name="246428511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246428511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246428511">(Jul 19 2021 at 08:28)</a>:</h4>
<p>thanks boxy &lt;3</p>



<a name="246437886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246437886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246437886">(Jul 19 2021 at 10:21)</a>:</h4>
<p>the additional error messages happen because select + fulfill for <code>ConstEquate</code> without <code>feature(const_evaluatable_checked)</code> actually returns an error when equating a <em>generic</em> constant with itself</p>



<a name="246437929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246437929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246437929">(Jul 19 2021 at 10:21)</a>:</h4>
<p>it didn't previously cause errors as we have an equivalence check in <code>super_combine_consts</code></p>



<a name="246438001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246438001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246438001">(Jul 19 2021 at 10:22)</a>:</h4>
<p>that equivalence check was now returning <code>false</code> if one of the consts has exposed default substs while the other one does not</p>



<a name="246438058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246438058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246438058">(Jul 19 2021 at 10:22)</a>:</h4>
<p>changed it to just expose all default substs before checking for equivalence here, this is kind of hack, but any other changes would be more invasive</p>



<a name="246438088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/anon%20const%20unused%20substs/near/246438088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/anon.20const.20unused.20substs.html#246438088">(Jul 19 2021 at 10:23)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">.</span><span class="n">expose_default_const_substs</span><span class="p">(</span><span class="n">a</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">.</span><span class="n">expose_default_const_substs</span><span class="p">(</span><span class="n">b</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">debug</span><span class="o">!</span><span class="p">(</span><span class="s">"{}.consts({:?}, {:?})"</span><span class="p">,</span><span class="w"> </span><span class="n">relation</span><span class="p">.</span><span class="n">tag</span><span class="p">(),</span><span class="w"> </span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="n">b</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="k">return</span><span class="w"> </span><span class="nb">Ok</span><span class="p">(</span><span class="n">a</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>